package com.cfec.educationplatform.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 
 * @TableName bet_user_topic
 */
@TableName(value ="bet_user_topic")
@Data
public class BetUserTopic {
    /**
     * id
     */
    @TableId
    private Integer betweenId;

    /**
     * 上传的题目id
     */
    private Integer topicId;

    /**
     * 用户id：谁上传的该的题目信息
     */
    private Integer userId;

    /**
     * 创建时间
     */

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 信息状态：0：弃用，1：使用
     */
    private String betweenState;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BetUserTopic other = (BetUserTopic) that;
        return (this.getBetweenId() == null ? other.getBetweenId() == null : this.getBetweenId().equals(other.getBetweenId()))
            && (this.getTopicId() == null ? other.getTopicId() == null : this.getTopicId().equals(other.getTopicId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getBetweenState() == null ? other.getBetweenState() == null : this.getBetweenState().equals(other.getBetweenState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBetweenId() == null) ? 0 : getBetweenId().hashCode());
        result = prime * result + ((getTopicId() == null) ? 0 : getTopicId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getBetweenState() == null) ? 0 : getBetweenState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", betweenId=").append(betweenId);
        sb.append(", topicId=").append(topicId);
        sb.append(", userId=").append(userId);
        sb.append(", creatTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", betweenState=").append(betweenState);
        sb.append("]");
        return sb.toString();
    }
}